#ifndef DOMINIO_H_
#define DOMINIO_H_

#include <iostream>
#include <list>
#include <string>
#include <ctime>

#include "URL.h"
#include "Robots.h"

class Dominio {
public:
	Dominio(){};
	Dominio(const std::string &aName, /*const std::string &theRobots,*/ const std::time_t &time);
	virtual ~Dominio() { delete robots;}
	
	//TimedURL getNextURL();
	void updateTimestamp(time_t newTimestamp) { 
		timestamp = newTimestamp;
//		_podeMaisUm = true;
	}
//	void insertNextURL(URLFeliz urlFeliz) { 
//		if (robots.isAllowed(urlFeliz.getPath()))
//			urlList.push_back(urlFeliz); 
//	}
	

	std::string getName() {return name;}
	std::time_t getTimestamp() {return timestamp;}
	bool isAllowedByRobots (URL * url) { return robots->isAllowed(url->get_path()); }
	
//	std::list<URLFeliz> getURLList() {return urlList;}
	//Robots getRobots() {return robots;}
//	bool podeMaisUm() {return _podeMaisUm;}
	//bool robotsValido() {return _robotsValido;}
	bool isRobotsValid() { return (robots!=NULL); }
	void setRobots (Robots * robs) { robots = robs; }
	
private:
	std::string name;
	Robots * robots;
	std::time_t timestamp;
	//bool _robotsValido;
	//static const int timeBetweenVisits;
};

//class Dominio {
//public:
//	Dominio(){};
//	Dominio(const std::string &aName, const std::string &theRobots, const std::time_t &time, const bool robotsValido);
//	virtual ~Dominio() {}
//	
//	TimedURL getNextURL();
//	void updateTimestamp(time_t newTimestamp) { 
//		timestamp = newTimestamp;
//		_podeMaisUm = true;
//	}
//	void insertNextURL(const URLFeliz urlFeliz) { urlList.push_back(urlFeliz); }
//		
//	std::list<URLFeliz> getURLList() {return urlList;}
//	std::string getName() {return name;}
//	std::string getRobots() {return robots;}
//	std::time_t getTimestamp() {return timestamp;}
//	bool podeMaisUm() {return _podeMaisUm;}
//	bool robotsValido() {return _robotsValido;}
//	
//private:
//	std::string name;
//	std::list <URLFeliz> urlList;
//	std::string robots;
//	std::time_t timestamp;
//	bool _podeMaisUm;
//	bool _robotsValido;
//	static const int timeBetweenVisits;
//};



#endif /*DOMINIO_H_*/
